package cn.share.life.common.sensitiveword.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.share.life.common.sensitiveword.dal.SensitiveWords;
import cn.share.life.common.sensitiveword.mapper.SensitiveWordsMapper;
import cn.share.life.common.sensitiveword.service.SensitiveWordsService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 敏感词(SensitiveWords)表服务实现类
 *
 * @author cxj
 * @since 2025-02-19 10:59:36
 */
@Service("sensitiveWordsService")
public class SensitiveWordsServiceImpl extends ServiceImpl<SensitiveWordsMapper, SensitiveWords> implements SensitiveWordsService {

    /**
     * 查询列表
     *
     * @param sensitiveWords
     * @return
     */
    @Override
    public List<SensitiveWords> list(SensitiveWords sensitiveWords) {
        return this.baseMapper.list(sensitiveWords);
    }

    @Override
    public boolean updateSensitiveWordCount(List<String> nameList) {
        if (CollectionUtils.isEmpty(nameList)) {
            return false;
        }
        int i = this.baseMapper.updateSensitiveWordCount(nameList);
        return i > 0;
    }


}

